import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.Path;

import java.net.URI;

/**
 * 创建时间：2018-09-09
 * <p>修改时间：2018-09-09
 * <p>类说明：
 *
 * @author peng
 * @version 1.0
 */
public class FileDelete {
    public static void main(String[] args) throws Exception {
        if (args.length != 1) {
            System.err.println("Usage: FileDelete <target>");
            System.exit(2);
        }

        Configuration conf = new Configuration();
        FileSystem fs = FileSystem.get(URI.create(args[0]), conf);
        fs.delete(new Path(args[0]), false);
    }
}
